/**
 * "Visual Paradigm: DO NOT MODIFY THIS FILE!"
 * 
 * This is an automatic generated file. It will be regenerated every time 
 * you generate persistence class.
 * 
 * Modifying its content may cause the program not work, or your work may lost.
 */

/**
 * Licensee: DuKe TeAm
 * License Type: Purchased
 */
package smartgrid;

import java.util.List;
import org.hibernate.criterion.DetachedCriteria;
import org.orm.PersistentSession;
import org.orm.criteria.*;

public class DataLineDetachedCriteria extends AbstractORMDetachedCriteria {
	public final IntegerExpression ID;
	public final DateExpression timeStamp;
	public final DoubleExpression Value;
	public final StringExpression Unit;
	public final ShortExpression Hora;
	public final ShortExpression Minuto;
	
	public DataLineDetachedCriteria() {
		super(smartgrid.DataLine.class, smartgrid.DataLineCriteria.class);
		ID = new IntegerExpression("ID", this.getDetachedCriteria());
		timeStamp = new DateExpression("timeStamp", this.getDetachedCriteria());
		Value = new DoubleExpression("Value", this.getDetachedCriteria());
		Unit = new StringExpression("Unit", this.getDetachedCriteria());
		Hora = new ShortExpression("Hora", this.getDetachedCriteria());
		Minuto = new ShortExpression("Minuto", this.getDetachedCriteria());
	}
	
	public DataLineDetachedCriteria(DetachedCriteria aDetachedCriteria) {
		super(aDetachedCriteria, smartgrid.DataLineCriteria.class);
		ID = new IntegerExpression("ID", this.getDetachedCriteria());
		timeStamp = new DateExpression("timeStamp", this.getDetachedCriteria());
		Value = new DoubleExpression("Value", this.getDetachedCriteria());
		Unit = new StringExpression("Unit", this.getDetachedCriteria());
		Hora = new ShortExpression("Hora", this.getDetachedCriteria());
		Minuto = new ShortExpression("Minuto", this.getDetachedCriteria());
	}
	
	public TariffDetachedCriteria createTariffCriteria() {
		return new TariffDetachedCriteria(createCriteria("tariff"));
	}
	
	public ContractDetachedCriteria createContractCriteria() {
		return new ContractDetachedCriteria(createCriteria("contract"));
	}
	
	public DataLine uniqueDataLine(PersistentSession session) {
		return (DataLine) super.createExecutableCriteria(session).uniqueResult();
	}
	
	public DataLine[] listDataLine(PersistentSession session) {
		List list = super.createExecutableCriteria(session).list();
		return (DataLine[]) list.toArray(new DataLine[list.size()]);
	}
}

